Skip to content

Allow install as mixin #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 15, 2020
Merged

Allow install as mixin #106

merged 2 commits into from
Oct 15, 2020

Conversation

shrpne
Copy link
Contributor

@shrpne shrpne commented Oct 14, 2020

Fixes #105

Now it also can be used like this:

import {AsyncComputedMixin} from 'vue-async-computed';

// my component
export default {
  mixins: [AsyncComputedMixin],
  data() {
    return {someValue: 123}
  },
  asyncComputed: {
    myAsyncValue() {/* ... */}
  }
}

Diff is pretty big, but it is because of whitespaces. In fact, there is only mixin moved to getAsyncComputedMixin and Vue.set replaced with vm.$set. So better to view with ignored whitespaces

Note: it may be breaking for users, who used it as const AsyncComputed = require('vue-async-computed') without interopRequire, because previously only default was exported and now both default and named are exported.

@foxbenjaminfox foxbenjaminfox merged commit 1bf4d61 into foxbenjaminfox:master Oct 15, 2020
@foxbenjaminfox
Copy link
Owner

OK, thanks—this looks reasonable, I've merged it.

I'm in the middle of trying to adapt this plugin for Vue 3 compatibility, and so I'll probably be releasing a new major version (with Vue 3 support) sometime soon. I think I'll probably include this change as part of that release. (Seeing as that will be a major version in any case, that will take care of the concerns about changing the export style.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to installation as mixin.
2 participants